package online.sixfish.common.eunmration;

import java.util.Arrays;
import java.util.List;

public enum QueProgramDifficultyEnum {
    EASY(1, "简单"),
    MEDIUM(2, "中等"),
    HARD(3, "困难");

    private final int id;
    private final String desc;

    QueProgramDifficultyEnum(int id, String desc) {
        this.id = id;
        this.desc = desc;
    }

    public int getId() {
        return id;
    }

    public String getDesc() {
        return desc;
    }

    public static QueProgramDifficultyEnum getById(int id) {
        for (QueProgramDifficultyEnum difficulty : QueProgramDifficultyEnum.values()) {
            if (id == difficulty.id) {
                return difficulty;
            }
        }
        return null;
    }

    public static List<QueProgramDifficultyEnum> getAllDifficulties() {
        return Arrays.asList(QueProgramDifficultyEnum.values());
    }
}